-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tmux): Add completion for alias functions #12278
Conversation
For what it's worth, if you do things like |
Ah, yes I see what you mean. Alternatively, the ZSH user repository provides a lot of good functionality for completion. I see other plugins have borrowed from them before, so maybe we can just import the relevant parts rather than re-inventing the wheel. I'll see if that's doable. |
@patrick96 thanks for the feedback. I've addressed your comment and now the following should happen:
|
9a70905
to
d38d7e2
Compare
Cleaned this up a bit so that completion for Barring any further feedback/cleanup, I think this good to go. |
Is my comment here valid?: #12282 (comment) Would changing the approach to setting an alias (as in the linked comment) vs defining a function be better? I don't know anything about this codebase but a quick test on my end seems to show that doing so would avoid having to reimplement any autocompletion functionality now or on future changes. |
Does the snippet you wrote provide more than the alias If the maintainers want to support better completion over my workflow preference to attach to the last session with |
Yes, the snippet replaces the current '_build_tmux_alias' function and can provide the same 4 aliases (ta, tad, tkss, ts) and ta, tad, and ts seem to work without a specified session as well as with. But I don't know if I don't follow what use case the 'if' statement is designed for so feel free to add the functionality you're looking for and I can always create my own aliases if I feel the need. I appreciate you figuring out a way to add the autocomplete back in to the new methodology. |
For some reason, I still get the error I had previously. Just to be sure, does your Otherwise, I'm testing as follows:
Everything else works, but I still get |
Yes, my And if I enter either of the commands However, my Ubuntu workstation on tmux 3.2a doesn't like it when I don't have an argument for EDIT: And it's clear now that of course my snippet would not solve this problem, only your function addresses the issue for <3.4. |
If you want more work ;) you could perhaps check for the tmux version and set the aliases to Thanks for making this functional for a wide range of tmux's. |
Thanks for confirming. That's weird because tmux didn't complain when I was on 3.2a (Linux/Nixos) and only started requiring an argument for |
fix(tmux): Add completion for alias functions
Fixes #12282
Standards checklist:
Changes:
ta
,tad
, andtkss
) introduced in fix(tmux): do not pass empty flags to aliases #12232.Other comments:
I barely understand the ZSH completion system, but this seems to get the job done.
ta<tab>
andtmux attach -t<tab>
seem to provide identical results. Any feedback is welcome.